package com.sambo.inspection.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.sambo.inspection.R;
import com.sambo.inspection.activity.support.ActivityCache;
import com.sambo.inspection.activity.support.BaseActivity;

public class OptionActivity extends BaseActivity implements View.OnClickListener {

    ImageView ivBack;
    RelativeLayout rlPersonInfo;
    RelativeLayout rlUpdatePassword;
    RelativeLayout rlQuit;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_option);

        ivBack = findViewById(R.id.iv_back);
        rlPersonInfo = findViewById(R.id.rl_person_info);
        rlUpdatePassword = findViewById(R.id.rl_update_password);
        rlQuit = findViewById(R.id.rl_quit);

        ivBack.setOnClickListener(this);
        rlPersonInfo.setOnClickListener(this);
        rlUpdatePassword.setOnClickListener(this);
        rlQuit.setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.iv_back:
                finish();
                break;
            case R.id.rl_person_info:
                Intent intent = new Intent(this,UserInfoActivity.class);
                startActivity(intent);
                break;
            case R.id.rl_update_password:
                Intent intent2 = new Intent(this,ResetPasswordActivity.class);
                startActivity(intent2);
                break;
            case R.id.rl_quit:
                ActivityCache.getScreenManager().popAllActivityExceptOne(LoginActivity.class);
                startActivity(new Intent(this, LoginActivity.class));
                break;
        }
    }
}
